package com.gyms.bean;

import com.amap.api.location.AMapLocation;

import java.io.Serializable;

import static com.gyms.Location.cityCode;

/**
 * ltx on 2016/12/9 10:24
 * 定位获取的bean
 */
public class LocationBean implements Serializable{
    private Long id;
    private String city;
    private String district;
    private String province;
    private String desc;
    private String provider;
    private String poiId;
    private String adCode;
    private Long cityId;
    private Long districtId;
    private Long provinceId;
    private Long time;
    private Double latitude;
    private Double longitude;
    private Double accuracy;
    private Double altitude;
    private Double bearing;
    private String address;

    public LocationBean() {
    }

    public LocationBean(Long id) {
        this.id = id;
    }

    public LocationBean(Long id, String city, String district, String province, String desc, String provider, String poiId, String adCode, Long cityId, Long districtId, Long provinceId, Long time, Double latitude, Double longitude, Double accuracy, Double altitude, Double bearing) {
        this.id = id;
        this.city = city;
        this.district = district;
        this.province = province;
        this.desc = desc;
        this.provider = provider;
        this.poiId = poiId;
        this.adCode = adCode;
        this.cityId = cityId;
        this.districtId = districtId;
        this.provinceId = provinceId;
        this.time = time;
        this.latitude = latitude;
        this.longitude = longitude;
        this.accuracy = accuracy;
        this.altitude = altitude;
        this.bearing = bearing;
    }

    public LocationBean(AMapLocation obj){
        if(null != obj){
            this.accuracy = (double)obj.getAccuracy();
            this.latitude = obj.getLatitude();
            this.longitude = obj.getLongitude();
            this.adCode = obj.getAdCode();
            this.altitude = obj.getAltitude();
            this.city = obj.getCity();
            this.district = obj.getDistrict();
            this.province = obj.getProvince();
            this.provider = obj.getProvider();
            this.time = obj.getTime();
            this.address=obj.getAddress();
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }


    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getProvider() {
        return provider;
    }

    public void setProvider(String provider) {
        this.provider = provider;
    }

    public String getPoiId() {
        return poiId;
    }

    public void setPoiId(String poiId) {
        this.poiId = poiId;
    }

    public String getAdCode() {
        return adCode;
    }

    public void setAdCode(String adCode) {
        this.adCode = adCode;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public Long getDistrictId() {
        return districtId;
    }

    public void setDistrictId(Long districtId) {
        this.districtId = districtId;
    }

    public Long getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Long provinceId) {
        this.provinceId = provinceId;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getAccuracy() {
        return accuracy;
    }

    public void setAccuracy(Double accuracy) {
        this.accuracy = accuracy;
    }

    public Double getAltitude() {
        return altitude;
    }

    public void setAltitude(Double altitude) {
        this.altitude = altitude;
    }

    public Double getBearing() {
        return bearing;
    }

    public void setBearing(Double bearing) {
        this.bearing = bearing;
    }

    @Override
    public String toString() {
        return "Location [id=" + id + ", city=" + city + ", cityCode=" + cityCode + ", district=" + district + ", province=" + province + ", desc=" + desc + ", provider=" + provider + ", poiId=" + poiId + ", adCode=" + adCode + ", cityId=" + cityId + ", districtId=" + districtId + ", provinceId=" + provinceId + ", time=" + time + ", latitude=" + latitude + ", longitude=" + longitude + ", accuracy=" + accuracy + ", altitude=" + altitude + ", bearing=" + bearing + "]";
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
